/**
 * @author zunqiang.Yi
 * @time 2023-10-21 11:07 AM
 * @description 进行路由拦截
 * */
import { NavigationGuardNext, RouteLocation } from "vue-router"
import { useCommonStore } from "../store"

 

export default function interceptor (to:RouteLocation,_:RouteLocation,next:NavigationGuardNext){
    if(to.meta.noIdentify){
        next()
    }else{
        let token = useCommonStore().token
        if(token){
            next()
        }else{
            next('/')
        }
    }
}